#include <iostream>
using namespace std;

class Person
{
public:
    Person()
    {
        cout << "Person()" << endl;
    }
    virtual ~Person()
    {
        cout << "~Person()" << endl;
    }

    virtual void run()
    {
        cout << "Person::run()" << endl;
    }

private:
    int m_age;

};

class Student : public Person
{
public:
    Student()
    {
        cout << "Student()" << endl;
    }
    ~Student()
    {
        cout << "~Student()" << endl;
    }

    virtual void run()
    {   
        Person::run();
        cout << "Student::run()" << endl;
    }

private:
    int m_score;

};

int main()
{

    /* reinterpret_cast没有安全检查*/
    Person * p1 = new Person();
    Person * p2 = new Student();
    Student * stu1 = reinterpret_cast<Student *> (p1);
    Student * stu2 = reinterpret_cast<Student *> (p2);

    int * p = reinterpret_cast<int *>(100);
    
    return 0;
}